<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
	<script type="text/javascript">
	 $(document).ready(function(){
		 $("#btnQuery").bind("click",doQuery);
		 $("#btnReset").bind("click",doReset);
		   //初始化日期控件
		   $('#framework_firstpage_more_dataDate').my97({
				  dateFmt:'yyyyMMdd',
				  startDate:[{
					 doubleCalendar:false,
					 isShowWeek:false,
					 isShowClear:false,
					 readOnly:true
				  }]
		   });
		   $("#framework_firstpage_more_periodType").combobox({
			   onSelect:function(){
				  var value=$(this).combobox("getValue");
				  $("#framework_firstpage_more_dataDate").val("");
				  if(value==3){//日
					  $('#framework_firstpage_more_dataDate').my97({
						  dateFmt:'yyyyMMdd',
						  startDate:[{
							 doubleCalendar:false,
							 isShowWeek:false,
							 isShowClear:false,
							 readOnly:true
						  }]
				       });
				  }else if(value==2){//月
					  $('#framework_firstpage_more_dataDate').my97({
						  dateFmt:'yyyyMM',
						  startDate:[{
							 doubleCalendar:false,
							 isShowWeek:false,
							 isShowClear:false,
							 readOnly:true
						  }]
				      });
				  }else{
					  $('#framework_firstpage_more_dataDate').my97({
						  dateFmt:'yyyyMMddHH',
						  startDate:[{
							 doubleCalendar:false,
							 isShowWeek:false,
							 isShowClear:false,
							 readOnly:true
						  }]
				      });
				  }
			   }
		   });
		   //初始化默认参数
		   $("#framework_firstpage_more_kpiName").val(decodeURI('${param.kqiName}'));
		   $("#framework_firstpage_more_periodType").combobox("setValue",'${param.periodType}');
		   $("#framework_firstpage_more_dataDate").val('${param.dataDate}');
		 $('#framework_firstpage_more_table').datagrid({
				url :'${pageContext.request.contextPath}/firstPageAction!getKpiStatisticMoreTableData.action',
				queryParams:serializeObject($('#framework_firstpage_more_form')),
				fit:true,
				border:false,
				fitColumns:true,
				pagination:true,
				striped:true,
				pageList:[10,15,20],
				singleSelect:false,
				pagePosition:'bottom',
				autoRowHeight:true,
				rownumbers:false,
				sortName:'datadate',
				 sortOrder:'desc',
				columns:[[  {field:'kqiName',title:'指标名称',width:180,align:'left',formatter:function(value,rowData,rowIndex){
					              return '<div style="width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title="'+rowData.kqiName+'">'+rowData.kqiName+'</div>';
				            }},
				            {field:'kqiVersionNum',title:'版本号',width:50,align:'center'},
	 						{field:'dataDate',title:'数据日期',width:60,align:'center',sortable:true},
	 						{field:'databaseId',title:'NoSQL数据库编码',width:85,align:'right'},
	 						{field:'formatCreateTime',title:'结果生成时间',width:100,align:'right'},
	 						{field:'runLog',title:'运行日志',width:100,align:'center'},
	 						{field:'runstatus',title:'运行状态',width:80,align:'center',formatter:function(value,rowData,rowIndex){
	 							if(rowData.runstatus==1){
	 								 return "<span style='color:#79be1e'>运行成功</span>";
	 							}else{
	 								 return "<span style='color:#f69216'>运行失败</span>";
	 							}
	 						}}
	 						
	 						
	 					]]
			});
	 });
    function doReset(){
		 $('#framework_firstpage_more_kpiName').val('');
		 $("#framework_firstpage_more_dataDate").val("");
		 $("#framework_firstpage_more_periodType").combobox("setValue",3);
		 $('#framework_firstpage_more_dataDate').my97({
			  dateFmt:'yyyyMMdd',
			  startDate:[{
				 doubleCalendar:false,
				 isShowWeek:false,
				 isShowClear:false,
				 readOnly:true
			  }]
	       });
	}
	//分页查询
	function doQuery()
	{
		var dataGridOptions=$('#framework_firstpage_more_table').datagrid('options');
			dataGridOptions.queryParams=serializeObject($('#framework_firstpage_more_form'));
			$('#framework_firstpage_more_table').datagrid(dataGridOptions);
			$('#framework_firstpage_more_table').datagrid('load');
	}
	</script>
    <form id="framework_firstpage_more_form">
        <div style="height:50px;border-bottom:none;border-top:none;overflow-x: hidden">
	    	<table   align="left" cellpadding="0" cellspacing="0" height="100%"  width="90%" >
	    		<tr>
		    		<td style="text-align:right;width:10%;" nowrap="nowrap">
		    			<label>指标名称：&nbsp;</label>
		    		</td>
					<td style="text-align:left;width:15%;" >
	    				 <input type="text" id="framework_firstpage_more_kpiName" name="kqiName"/>
					</td>
					<td style="text-align:right;width:10%;" nowrap="nowrap">
						<label>数据日期：&nbsp;</label>
					</td>
					<td style="text-align:left;width:25%;" >
	    				<select  id="framework_firstpage_more_periodType"  name="periodType"   class="easyui-combobox" data-options="editable:false"  style="width:40px;margin-right:5px;" panelHeight='auto'>
							<option value="3" selected="selected">日</option>
							<option value="2">月</option>
							<option value="4">时</option>
						</select>&nbsp;
						<input type="date" id="framework_firstpage_more_dataDate" name="dataDate" />
					</td>
					<td colspan="2" style="width:15%;text-align:right;" nowrap="nowrap" >	   
			    		<input type="button" id="btnQuery" name="" value="查 询" style="cursor:pointer;background-image: url('${pageContext.request.contextPath}/images/login/search.png');background-repeat: no-repeat;width:67px;height:23px;padding-left:12px;border:none;color:white;font-family:微软雅黑;"/>	
			    		<input type="button" id="btnReset" name="" value="重 置" style="cursor:pointer;background-image: url('${pageContext.request.contextPath}/images/login/reset.png');background-repeat: no-repeat;width:67px;height:23px;padding-left:12px;border:none;color:white;font-family:微软雅黑;margin-right:20px"/>				
	    			</td>
	    		</tr>
			</table>
	    </div>  
		<div  style="border-top:1px solid #cbcbcb;height:346px;"  class="easyui-panel">
			<table id="framework_firstpage_more_table"></table>
		</div>
    </form>